﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Word;

namespace BAASearchLib
{
    public class DocToTextWordApp
    {
        private static Microsoft.Office.Interop.Word.Application wordApp = null;

        private static object objFalse = false;
        private static object missing = System.Reflection.Missing.Value;

        public static Microsoft.Office.Interop.Word.Application WordApp
        {
            get
            {
                if (wordApp == null)
                    wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
                return wordApp;
            }
        }

        public static void Close()
        {
            (WordApp as _Application).Quit(ref objFalse, ref missing, ref missing);
            wordApp = null;
        }
    }
}
